/* 主题系统 - MMD模型资源管理中心 */

/* ===== 黑金主题 (默认) ===== */
[data-theme="black-gold"] {
  --primary-black: #0a0a0a;
  --secondary-black: #1a1a1a;
  --tertiary-black: #2a2a2a;
  --gold-primary: #d4af37;
  --gold-secondary: #b8860b;
  --gold-accent: #ffd700;
  --gold-light: #f4e4bc;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --border-gold: #d4af37;
  --border-dark: #333333;
  --shadow-gold: rgba(212, 175, 55, 0.2);
  --shadow-dark: rgba(0, 0, 0, 0.5);
  --gradient-gold: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  --gradient-dark: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  --gradient-card: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* ===== 宝石青绿主题 ===== */
[data-theme="emerald-green"] {
  --primary-black: #0d1b1a;
  --secondary-black: #1a2f2d;
  --tertiary-black: #2a3f3d;
  --gold-primary: #10b981;
  --gold-secondary: #059669;
  --gold-accent: #34d399;
  --gold-light: #d1fae5;
  --text-primary: #ffffff;
  --text-secondary: #d1fae5;
  --text-muted: #6b7280;
  --border-gold: #10b981;
  --border-dark: #374151;
  --shadow-gold: rgba(16, 185, 129, 0.2);
  --shadow-dark: rgba(0, 0, 0, 0.5);
  --gradient-gold: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-dark: linear-gradient(135deg, #0d1b1a 0%, #1a2f2d 100%);
  --gradient-card: linear-gradient(145deg, #1a2f2d 0%, #2a3f3d 100%);
}

/* ===== 简洁黑白主题 ===== */
[data-theme="simple-black"] {
  --primary-black: #000000;
  --secondary-black: #1a1a1a;
  --tertiary-black: #2a2a2a;
  --gold-primary: #ffffff;
  --gold-secondary: #e5e5e5;
  --gold-accent: #f5f5f5;
  --gold-light: #fafafa;
  --text-primary: #ffffff;
  --text-secondary: #e5e5e5;
  --text-muted: #a0a0a0;
  --border-gold: #ffffff;
  --border-dark: #333333;
  --shadow-gold: rgba(255, 255, 255, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.5);
  --gradient-gold: linear-gradient(135deg, #ffffff 0%, #e5e5e5 100%);
  --gradient-dark: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  --gradient-card: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* ===== 配色主题 ===== */

/* 金色配色 (默认) */
[data-color="gold"] {
  --accent-primary: #d4af37;
  --accent-secondary: #b8860b;
  --accent-accent: #ffd700;
  --accent-light: #f4e4bc;
  --border-accent: #d4af37;
  --shadow-accent: rgba(212, 175, 55, 0.2);
  --gradient-accent: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
}

/* 红色配色 */
[data-color="red"] {
  --accent-primary: #dc3545;
  --accent-secondary: #c82333;
  --accent-accent: #ff4757;
  --accent-light: #ffebee;
  --border-accent: #dc3545;
  --shadow-accent: rgba(220, 53, 69, 0.2);
  --gradient-accent: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* 蓝色配色 */
[data-color="blue"] {
  --accent-primary: #007bff;
  --accent-secondary: #0056b3;
  --accent-accent: #4dabf7;
  --accent-light: #e3f2fd;
  --border-accent: #007bff;
  --shadow-accent: rgba(0, 123, 255, 0.2);
  --gradient-accent: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* 绿色配色 */
[data-color="green"] {
  --accent-primary: #28a745;
  --accent-secondary: #1e7e34;
  --accent-accent: #51cf66;
  --accent-light: #d4edda;
  --border-accent: #28a745;
  --shadow-accent: rgba(40, 167, 69, 0.2);
  --gradient-accent: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* 将配色变量映射到通用色板，保证 data-color 能覆盖主题的金色系变量 */
[data-color] {
  --gold-primary: var(--accent-primary);
  --gold-secondary: var(--accent-secondary);
  --gold-accent: var(--accent-accent);
  --gold-light: var(--accent-light);
  --border-gold: var(--border-accent);
  --shadow-gold: var(--shadow-accent);
  --gradient-gold: var(--gradient-accent);
}

/* ===== 普通配色主题 (白色背景) ===== */

/* 普通红色主题 */
[data-theme="simple-red"] {
  --primary-black: #ffffff;
  --secondary-black: #f8f9fa;
  --tertiary-black: #e9ecef;
  --gold-primary: #dc3545;
  --gold-secondary: #c82333;
  --gold-accent: #ff4757;
  --gold-light: #ffebee;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-gold: #dc3545;
  --border-dark: #dee2e6;
  --shadow-gold: rgba(220, 53, 69, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.1);
  --gradient-gold: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  --gradient-dark: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

/* 普通黄色主题 */
[data-theme="simple-yellow"] {
  --primary-black: #ffffff;
  --secondary-black: #f8f9fa;
  --tertiary-black: #e9ecef;
  --gold-primary: #ffc107;
  --gold-secondary: #e0a800;
  --gold-accent: #ffca2c;
  --gold-light: #fff3cd;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-gold: #ffc107;
  --border-dark: #dee2e6;
  --shadow-gold: rgba(255, 193, 7, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.1);
  --gradient-gold: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  --gradient-dark: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

/* 普通蓝色主题 */
[data-theme="simple-blue"] {
  --primary-black: #ffffff;
  --secondary-black: #f8f9fa;
  --tertiary-black: #e9ecef;
  --gold-primary: #007bff;
  --gold-secondary: #0056b3;
  --gold-accent: #4dabf7;
  --gold-light: #e3f2fd;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-gold: #007bff;
  --border-dark: #dee2e6;
  --shadow-gold: rgba(0, 123, 255, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.1);
  --gradient-gold: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  --gradient-dark: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

/* 普通绿色主题 */
[data-theme="simple-green"] {
  --primary-black: #ffffff;
  --secondary-black: #f8f9fa;
  --tertiary-black: #e9ecef;
  --gold-primary: #28a745;
  --gold-secondary: #1e7e34;
  --gold-accent: #51cf66;
  --gold-light: #d4edda;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-gold: #28a745;
  --border-dark: #dee2e6;
  --shadow-gold: rgba(40, 167, 69, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.1);
  --gradient-gold: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  --gradient-dark: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

/* ===== 主题预览样式 ===== */

/* 黑金主题预览 */
.bg-gradient-to-br.from-gray-900.to-yellow-600 {
  background: linear-gradient(135deg, #111827 0%, #d97706 100%);
}

/* 宝石青绿主题预览 */
.bg-gradient-to-br.from-emerald-800.to-teal-500 {
  background: linear-gradient(135deg, #065f46 0%, #14b8a6 100%);
}

/* 简洁黑白主题预览 */
.bg-gradient-to-br.from-gray-900.to-gray-600 {
  background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
}

/* ===== 主题切换动画 ===== */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* 确保CSS变量优先级 */
html[data-theme] {
  /* 强制应用主题变量 */
}

html[data-color] {
  /* 强制应用配色变量 */
}

/* ===== 响应式主题适配 ===== */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    /* 自动主题 - 跟随系统 */
  }
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    /* 自动主题 - 跟随系统 */
  }
}
